n=int(input())
weights=list(map(int,input().split()))

def getResult(n,weights):
    weights.sort()
    minv=weights[0]
    faultSum=minv
    correctSum=minv
    for i in range(1,n):
        correctSum=correctSum+weights[i]
        faultSum=faultSum^weights[i]
    if faultSum==0:
        return str(correctSum-minv)
    else:
        return "NO"
print(getResult(n,weights))
# 3 5 6

